package net.zrnecko.bowlingnumbers.session;

import net.zrnecko.bowlingnumbers.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.List;
import java.util.Arrays;

@Name("gameBlockList")
public class GameBlockList extends EntityQuery {

	private static final String[] RESTRICTIONS = {"lower(gameBlock.description) like concat(lower(#{gameBlockList.gameBlock.description}),'%')",};

	private GameBlock gameBlock = new GameBlock();

	@Override
	public String getEjbql() {
		return "select gameBlock from GameBlock gameBlock";
	}

	@Override
	public Integer getMaxResults() {
		return 25;
	}

	public GameBlock getGameBlock() {
		return gameBlock;
	}

	@Override
	public List<String> getRestrictions() {
		return Arrays.asList(RESTRICTIONS);
	}

}
